//
//  IllegalController.m
//  EagleEye
//
//  Created by 18_李明明 on 15-1-20.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "IllegalController.h"

@interface IllegalController ()<UIWebViewDelegate>
@property (nonatomic, strong) UIActivityIndicatorView *indicator;
@end

@implementation IllegalController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UIWebView *web = [[UIWebView alloc] initWithFrame:self.view.frame];
    NSString *path = @"http://app.eclicks.cn/violation2/webapp/index?appid=10";
    NSURL *url = [NSURL URLWithString:[path stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
    [web loadRequest:request];
    web.scrollView.bounces = YES;
    [self.view addSubview:web];
    web.delegate = self;
    self.indicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(WIDTH / 2, WIDTH, 50, 50)];
        self.indicator.center = CGPointMake(WIDTH / 2, HEIGHT / 2 - 64);
    //    self.indicator.center = CGPointMake(self.view.frame.origin.x / 2, self.view.frame.origin.y / 2);
    self.indicator.backgroundColor = [UIColor blackColor];
    self.indicator.alpha = 0.5;
    [self.view addSubview:self.indicator];
//    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:self action:@selector(targetCancle:)];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"cancle.png"] style:UIBarButtonItemStylePlain target:self action:@selector(targetCancle:)];
}
- (void)targetCancle:(UIButton *)cancle
{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)webViewDidStartLoad:(UIWebView *)webView
{
   
    [self.indicator startAnimating];
    NSLog(@"开始加载");
}
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    [self.indicator stopAnimating];
    NSLog(@"加载结束");
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
